Optimal. Leaf size=223 \[ -\frac {B (b c-a d)^4 g^3 i n x}{20 b d^3}+\frac {B (b c-a d)^3 g^3 i n (a+b x)^2}{40 b^2 d^2}-\frac {B (b c-a d)^2 g^3 i n (a+b x)^3}{60 b^2 d}+\frac {g^3 i (a+b x)^4 (c+d x) \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{5 b}+\frac {(b c-a d) g^3 i (a+b x)^4 \left (A-B n+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{20 b^2}+\frac {B (b c-a d)^5 g^3 i n \log (c+d x)}{20 b^2 d^4} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 223, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.098, Rules used = {2559, 2547, 21,
45} \begin {gather*} \frac {g^3 i (a+b x)^4 (b c-a d) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A-B n\right )}{20 b^2}+\frac {g^3 i (a+b x)^4 (c+d x) \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{5 b}+\frac {B g^3 i n (b c-a d)^5 \log (c+d x)}{20 b^2 d^4}+\frac {B g^3 i n (a+b x)^2 (b c-a d)^3}{40 b^2 d^2}-\frac {B g^3 i n (a+b x)^3 (b c-a d)^2}{60 b^2 d}-\frac {B g^3 i n x (b c-a d)^4}{20 b d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 45
Rule 2547
Rule 2559
Rubi steps
\begin {align*} \int (108 c+108 d x) (a g+b g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx &=\int \left (\frac {108 (b c-a d) (a g+b g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b}+\frac {108 d (a g+b g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b g}\right ) \, dx\\ &=\frac {(108 (b c-a d)) \int (a g+b g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx}{b}+\frac {(108 d) \int (a g+b g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx}{b g}\\ &=\frac {27 (b c-a d) g^3 (a+b x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b^2}+\frac {108 d g^3 (a+b x)^5 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{5 b^2}-\frac {(108 B d n) \int \frac {(b c-a d) g^5 (a+b x)^4}{c+d x} \, dx}{5 b^2 g^2}-\frac {(27 B (b c-a d) n) \int \frac {(b c-a d) g^4 (a+b x)^3}{c+d x} \, dx}{b^2 g}\\ &=\frac {27 (b c-a d) g^3 (a+b x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b^2}+\frac {108 d g^3 (a+b x)^5 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{5 b^2}-\frac {\left (108 B d (b c-a d) g^3 n\right ) \int \frac {(a+b x)^4}{c+d x} \, dx}{5 b^2}-\frac {\left (27 B (b c-a d)^2 g^3 n\right ) \int \frac {(a+b x)^3}{c+d x} \, dx}{b^2}\\ &=\frac {27 (b c-a d) g^3 (a+b x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b^2}+\frac {108 d g^3 (a+b x)^5 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{5 b^2}-\frac {\left (108 B d (b c-a d) g^3 n\right ) \int \left (-\frac {b (b c-a d)^3}{d^4}+\frac {b (b c-a d)^2 (a+b x)}{d^3}-\frac {b (b c-a d) (a+b x)^2}{d^2}+\frac {b (a+b x)^3}{d}+\frac {(-b c+a d)^4}{d^4 (c+d x)}\right ) \, dx}{5 b^2}-\frac {\left (27 B (b c-a d)^2 g^3 n\right ) \int \left (\frac {b (b c-a d)^2}{d^3}-\frac {b (b c-a d) (a+b x)}{d^2}+\frac {b (a+b x)^2}{d}+\frac {(-b c+a d)^3}{d^3 (c+d x)}\right ) \, dx}{b^2}\\ &=-\frac {27 B (b c-a d)^4 g^3 n x}{5 b d^3}+\frac {27 B (b c-a d)^3 g^3 n (a+b x)^2}{10 b^2 d^2}-\frac {9 B (b c-a d)^2 g^3 n (a+b x)^3}{5 b^2 d}-\frac {27 B (b c-a d) g^3 n (a+b x)^4}{5 b^2}+\frac {27 (b c-a d) g^3 (a+b x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{b^2}+\frac {108 d g^3 (a+b x)^5 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{5 b^2}+\frac {27 B (b c-a d)^5 g^3 n \log (c+d x)}{5 b^2 d^4}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 269, normalized size = 1.21 \begin {gather*} \frac {g^3 i \left (30 (b c-a d) (a+b x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )+24 d (a+b x)^5 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {5 B (b c-a d)^2 n \left (6 b d (b c-a d)^2 x+3 d^2 (-b c+a d) (a+b x)^2+2 d^3 (a+b x)^3-6 (b c-a d)^3 \log (c+d x)\right )}{d^4}+\frac {2 B (b c-a d) n \left (12 b d (b c-a d)^3 x-6 d^2 (b c-a d)^2 (a+b x)^2+4 d^3 (b c-a d) (a+b x)^3-3 d^4 (a+b x)^4-12 (b c-a d)^4 \log (c+d x)\right )}{d^4}\right )}{120 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.09, size = 0, normalized size = 0.00 \[\int \left (b g x +a g \right )^{3} \left (d i x +c i \right ) \left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 1109 vs. \(2 (209) = 418\).
time = 0.32, size = 1109, normalized size = 4.97 \begin {gather*} \frac {1}{5} i \, B b^{3} d g^{3} x^{5} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {1}{5} i \, A b^{3} d g^{3} x^{5} + \frac {1}{4} i \, B b^{3} c g^{3} x^{4} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {3}{4} i \, B a b^{2} d g^{3} x^{4} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {1}{4} i \, A b^{3} c g^{3} x^{4} + \frac {3}{4} i \, A a b^{2} d g^{3} x^{4} + i \, B a b^{2} c g^{3} x^{3} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + i \, B a^{2} b d g^{3} x^{3} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + i \, A a b^{2} c g^{3} x^{3} + i \, A a^{2} b d g^{3} x^{3} + \frac {3}{2} i \, B a^{2} b c g^{3} x^{2} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {1}{2} i \, B a^{3} d g^{3} x^{2} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {3}{2} i \, A a^{2} b c g^{3} x^{2} + \frac {1}{2} i \, A a^{3} d g^{3} x^{2} + \frac {1}{60} i \, B b^{3} d g^{3} n {\left (\frac {12 \, a^{5} \log \left (b x + a\right )}{b^{5}} - \frac {12 \, c^{5} \log \left (d x + c\right )}{d^{5}} - \frac {3 \, {\left (b^{4} c d^{3} - a b^{3} d^{4}\right )} x^{4} - 4 \, {\left (b^{4} c^{2} d^{2} - a^{2} b^{2} d^{4}\right )} x^{3} + 6 \, {\left (b^{4} c^{3} d - a^{3} b d^{4}\right )} x^{2} - 12 \, {\left (b^{4} c^{4} - a^{4} d^{4}\right )} x}{b^{4} d^{4}}\right )} - \frac {1}{24} i \, B b^{3} c g^{3} n {\left (\frac {6 \, a^{4} \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} x^{2} + 6 \, {\left (b^{3} c^{3} - a^{3} d^{3}\right )} x}{b^{3} d^{3}}\right )} - \frac {1}{8} i \, B a b^{2} d g^{3} n {\left (\frac {6 \, a^{4} \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} x^{2} + 6 \, {\left (b^{3} c^{3} - a^{3} d^{3}\right )} x}{b^{3} d^{3}}\right )} + \frac {1}{2} i \, B a b^{2} c g^{3} n {\left (\frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} + \frac {1}{2} i \, B a^{2} b d g^{3} n {\left (\frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} - \frac {3}{2} i \, B a^{2} b c g^{3} n {\left (\frac {a^{2} \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c - a d\right )} x}{b d}\right )} - \frac {1}{2} i \, B a^{3} d g^{3} n {\left (\frac {a^{2} \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c - a d\right )} x}{b d}\right )} + i \, B a^{3} c g^{3} n {\left (\frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} + i \, B a^{3} c g^{3} x \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + i \, A a^{3} c g^{3} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 635 vs. \(2 (209) = 418\).
time = 0.50, size = 635, normalized size = 2.85 \begin {gather*} -\frac {24 \, {\left (-i \, A - i \, B\right )} b^{5} d^{5} g^{3} x^{5} + 6 \, {\left (-5 i \, B a^{4} b c d^{4} + i \, B a^{5} d^{5}\right )} g^{3} n \log \left (\frac {b x + a}{b}\right ) + 6 \, {\left (-i \, B b^{5} c^{5} + 5 i \, B a b^{4} c^{4} d - 10 i \, B a^{2} b^{3} c^{3} d^{2} + 10 i \, B a^{3} b^{2} c^{2} d^{3}\right )} g^{3} n \log \left (\frac {d x + c}{d}\right ) + 6 \, {\left ({\left (i \, B b^{5} c d^{4} - i \, B a b^{4} d^{5}\right )} g^{3} n + 5 \, {\left ({\left (-i \, A - i \, B\right )} b^{5} c d^{4} + 3 \, {\left (-i \, A - i \, B\right )} a b^{4} d^{5}\right )} g^{3}\right )} x^{4} + 2 \, {\left ({\left (i \, B b^{5} c^{2} d^{3} + 10 i \, B a b^{4} c d^{4} - 11 i \, B a^{2} b^{3} d^{5}\right )} g^{3} n + 60 \, {\left ({\left (-i \, A - i \, B\right )} a b^{4} c d^{4} + {\left (-i \, A - i \, B\right )} a^{2} b^{3} d^{5}\right )} g^{3}\right )} x^{3} + 3 \, {\left ({\left (-i \, B b^{5} c^{3} d^{2} + 5 i \, B a b^{4} c^{2} d^{3} + 5 i \, B a^{2} b^{3} c d^{4} - 9 i \, B a^{3} b^{2} d^{5}\right )} g^{3} n + 20 \, {\left (3 \, {\left (-i \, A - i \, B\right )} a^{2} b^{3} c d^{4} + {\left (-i \, A - i \, B\right )} a^{3} b^{2} d^{5}\right )} g^{3}\right )} x^{2} + 6 \, {\left (20 \, {\left (-i \, A - i \, B\right )} a^{3} b^{2} c d^{4} g^{3} + {\left (i \, B b^{5} c^{4} d - 5 i \, B a b^{4} c^{3} d^{2} + 10 i \, B a^{2} b^{3} c^{2} d^{3} - 5 i \, B a^{3} b^{2} c d^{4} - i \, B a^{4} b d^{5}\right )} g^{3} n\right )} x + 6 \, {\left (-4 i \, B b^{5} d^{5} g^{3} n x^{5} - 20 i \, B a^{3} b^{2} c d^{4} g^{3} n x + 5 \, {\left (-i \, B b^{5} c d^{4} - 3 i \, B a b^{4} d^{5}\right )} g^{3} n x^{4} + 20 \, {\left (-i \, B a b^{4} c d^{4} - i \, B a^{2} b^{3} d^{5}\right )} g^{3} n x^{3} + 10 \, {\left (-3 i \, B a^{2} b^{3} c d^{4} - i \, B a^{3} b^{2} d^{5}\right )} g^{3} n x^{2}\right )} \log \left (\frac {b x + a}{d x + c}\right )}{120 \, b^{2} d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 3847 vs. \(2 (209) = 418\).
time = 3.50, size = 3847, normalized size = 17.25 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.62, size = 1237, normalized size = 5.55 \begin {gather*} x\,\left (\frac {a\,c\,\left (\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{20}\right )}{20\,b\,d}-\frac {b\,g^3\,i\,\left (24\,A\,a^2\,d^2+4\,A\,b^2\,c^2+3\,B\,a^2\,d^2\,n-B\,b^2\,c^2\,n+32\,A\,a\,b\,c\,d-2\,B\,a\,b\,c\,d\,n\right )}{4\,d}+A\,a\,b^2\,c\,g^3\,i\right )}{b\,d}-\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{20}\right )}{20\,b\,d}-\frac {b\,g^3\,i\,\left (24\,A\,a^2\,d^2+4\,A\,b^2\,c^2+3\,B\,a^2\,d^2\,n-B\,b^2\,c^2\,n+32\,A\,a\,b\,c\,d-2\,B\,a\,b\,c\,d\,n\right )}{4\,d}+A\,a\,b^2\,c\,g^3\,i\right )}{20\,b\,d}-\frac {a\,c\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{20}\right )}{b\,d}+\frac {a\,g^3\,i\,\left (4\,A\,a^2\,d^2+4\,A\,b^2\,c^2+B\,a^2\,d^2\,n-B\,b^2\,c^2\,n+12\,A\,a\,b\,c\,d\right )}{d}\right )}{20\,b\,d}+\frac {a^2\,g^3\,i\,\left (2\,A\,a^2\,d^2+12\,A\,b^2\,c^2+B\,a^2\,d^2\,n-3\,B\,b^2\,c^2\,n+16\,A\,a\,b\,c\,d+2\,B\,a\,b\,c\,d\,n\right )}{2\,b\,d}\right )+x^2\,\left (\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{20}\right )}{20\,b\,d}-\frac {b\,g^3\,i\,\left (24\,A\,a^2\,d^2+4\,A\,b^2\,c^2+3\,B\,a^2\,d^2\,n-B\,b^2\,c^2\,n+32\,A\,a\,b\,c\,d-2\,B\,a\,b\,c\,d\,n\right )}{4\,d}+A\,a\,b^2\,c\,g^3\,i\right )}{40\,b\,d}-\frac {a\,c\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{20}\right )}{2\,b\,d}+\frac {a\,g^3\,i\,\left (4\,A\,a^2\,d^2+4\,A\,b^2\,c^2+B\,a^2\,d^2\,n-B\,b^2\,c^2\,n+12\,A\,a\,b\,c\,d\right )}{2\,d}\right )-x^3\,\left (\frac {\left (20\,a\,d+20\,b\,c\right )\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{5}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{20}\right )}{60\,b\,d}-\frac {b\,g^3\,i\,\left (24\,A\,a^2\,d^2+4\,A\,b^2\,c^2+3\,B\,a^2\,d^2\,n-B\,b^2\,c^2\,n+32\,A\,a\,b\,c\,d-2\,B\,a\,b\,c\,d\,n\right )}{12\,d}+\frac {A\,a\,b^2\,c\,g^3\,i}{3}\right )+\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (\frac {B\,a^2\,g^3\,i\,x^2\,\left (a\,d+3\,b\,c\right )}{2}+\frac {B\,b^2\,g^3\,i\,x^4\,\left (3\,a\,d+b\,c\right )}{4}+B\,a^3\,c\,g^3\,i\,x+\frac {B\,b^3\,d\,g^3\,i\,x^5}{5}+B\,a\,b\,g^3\,i\,x^3\,\left (a\,d+b\,c\right )\right )+x^4\,\left (\frac {b^2\,g^3\,i\,\left (20\,A\,a\,d+10\,A\,b\,c+B\,a\,d\,n-B\,b\,c\,n\right )}{20}-\frac {A\,b^2\,g^3\,i\,\left (20\,a\,d+20\,b\,c\right )}{80}\right )-\frac {\ln \left (a+b\,x\right )\,\left (B\,a^5\,d\,g^3\,i\,n-5\,B\,a^4\,b\,c\,g^3\,i\,n\right )}{20\,b^2}+\frac {\ln \left (c+d\,x\right )\,\left (-10\,B\,i\,n\,a^3\,c^2\,d^3\,g^3+10\,B\,i\,n\,a^2\,b\,c^3\,d^2\,g^3-5\,B\,i\,n\,a\,b^2\,c^4\,d\,g^3+B\,i\,n\,b^3\,c^5\,g^3\right )}{20\,d^4}+\frac {A\,b^3\,d\,g^3\,i\,x^5}{5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________